<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>glPrimitiveBoundingBox - OpenGL ES 3.2 Reference Pages</title>
    <link rel="stylesheet" type="text/css" href="opengl-man.css"/>
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1"/>
    <script type="text/x-mathjax-config">
            MathJax.Hub.Config({
                MathML: {
                    extensions: ["content-mathml.js"]
                },
                tex2jax: {
                    inlineMath: [['$','$'], ['\\(','\\)']]
                }
            });
        </script>
    <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"/>
  </head>
  <body>
    <header/>
    <div class="refentry" id="glPrimitiveBoundingBox">
      <div class="titlepage"/>
      <div class="refnamediv">
        <h2>Name</h2>
        <p>glPrimitiveBoundingBox — set the bounding box for a primitive</p>
      </div>
      <div class="refsynopsisdiv">
        <h2>C Specification</h2>
        <div class="funcsynopsis">
          <table style="border: 0; cellspacing: 0; cellpadding: 0;" class="funcprototype-table">
            <tr>
              <td>
                <code class="funcdef">void <strong class="fsfunc">glPrimitiveBoundingBox</strong>(</code>
              </td>
              <td>GLfloat <var class="pdparam">minX</var>, </td>
            </tr>
            <tr>
              <td> </td>
              <td>GLfloat <var class="pdparam">minY</var>, </td>
            </tr>
            <tr>
              <td> </td>
              <td>GLfloat <var class="pdparam">minZ</var>, </td>
            </tr>
            <tr>
              <td> </td>
              <td>GLfloat <var class="pdparam">minW</var>, </td>
            </tr>
            <tr>
              <td> </td>
              <td>GLfloat <var class="pdparam">maxX</var>, </td>
            </tr>
            <tr>
              <td> </td>
              <td>GLfloat <var class="pdparam">maxY</var>, </td>
            </tr>
            <tr>
              <td> </td>
              <td>GLfloat <var class="pdparam">maxZ</var>, </td>
            </tr>
            <tr>
              <td> </td>
              <td>GLfloat <var class="pdparam">maxW</var><code>)</code>;</td>
            </tr>
          </table>
          <div class="funcprototype-spacer"> </div>
        </div>
      </div>
      <div class="refsect1" id="parameters">
        <h2>Parameters</h2>
        <div class="variablelist">
          <dl class="variablelist">
            <dt>
              <span class="term"><em class="parameter"><code>minX</code></em>, </span>
              <span class="term"><em class="parameter"><code>minY</code></em>, </span>
              <span class="term"><em class="parameter"><code>minZ</code></em>, </span>
              <span class="term">
                <em class="parameter">
                  <code>minW</code>
                </em>
              </span>
            </dt>
            <dd>
              <p>
                    Specify the minimum clip space cooridnate of the bounding box. The initial value is (-1, -1, -1, -1).
                </p>
            </dd>
            <dt>
              <span class="term"><em class="parameter"><code>maxX</code></em>, </span>
              <span class="term"><em class="parameter"><code>maxY</code></em>, </span>
              <span class="term"><em class="parameter"><code>maxZ</code></em>, </span>
              <span class="term">
                <em class="parameter">
                  <code>maxW</code>
                </em>
              </span>
            </dt>
            <dd>
              <p>
                    Specify the maximum clip space cooridnate of the bounding box. The initial value is (1, 1, 1, 1).
                </p>
            </dd>
          </dl>
        </div>
      </div>
      <div class="refsect1" id="description">
        <h2>Description</h2>
        <p>
            <code class="function">glPrimitiveBoundingBox</code> specifies a clip space bounding box which may allow
            implementations to optimize performance if the application
            provides bounds of primitives that will be generated by the tessellation
            primitive generator or the geometry shader prior to executing those stages.
            If the provided bounds are incorrect and primitives extend beyond them, the
            rasterizer may or may not generate fragments for the portions of primitives
            outside the bounds.
        </p>
        <p>
            The bounding box in clip space is composed of 16 vertices formed by all
            combinations of the minimum and maximum values for each dimension. This
            bounding box is clipped against 
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
                
                <mml:msub><mml:mi mathvariant="italic">w</mml:mi>
                <mml:mi mathvariant="italic">c</mml:mi>
                </mml:msub>
                <mml:mo>&gt;</mml:mo>
                <mml:mn>0</mml:mn>
            </mml:math>
            and projected to three dimensions
            by dividing 
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
                
                <mml:msub><mml:mi mathvariant="italic">x</mml:mi>
                <mml:mi mathvariant="italic">c</mml:mi>
                </mml:msub>
            </mml:math>,
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
                
                <mml:msub><mml:mi mathvariant="italic">y</mml:mi>
                <mml:mi mathvariant="italic">c</mml:mi>
                </mml:msub>
            </mml:math>, and            
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
                
                <mml:msub><mml:mi mathvariant="italic">z</mml:mi>
                <mml:mi mathvariant="italic">c</mml:mi>
                </mml:msub>
            </mml:math> by            
            <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" overflow="scroll">
                
                <mml:msub><mml:mi mathvariant="italic">w</mml:mi>
                <mml:mi mathvariant="italic">c</mml:mi>
                </mml:msub>
            </mml:math>            
            for each vertex. The viewport transform
            is then applied to each vertex to produce a three-dimensional bounding
            volume in window coordinates. The window space bounding volume is expanded in the X and Y dimensions to
            accomodate the rasterization rules for the primitive type, and to fall on
            fragment boundaries.
        </p>
        <p>
            If tessellation is active, each invocation of the tessellation control
            shader may re-specify the bounding box by writing to the built-in
            <a class="citerefentry" href="gl_BoundingBox.xhtml"><span class="citerefentry"><span class="refentrytitle">gl_BoundingBox</span></span></a>[] variable. 
            If the shader statically assigns a value to
            any part of this variable, then gl_BoundingBox[0] is used instead of
            <em class="parameter"><code>minX</code></em>, <em class="parameter"><code>minY</code></em>, <em class="parameter"><code>minZ</code></em>, 
            <em class="parameter"><code>minW</code></em>, and gl_BoundingBox[1] is used instead of
            <em class="parameter"><code>maxX</code></em>, <em class="parameter"><code>maxY</code></em>, <em class="parameter"><code>maxZ</code></em>, 
            <em class="parameter"><code>maxW</code></em>.  If the shader contains a static assignment
            to gl_BoundingBox[] and there is an execution path through the shader
            that does not write all components of gl_BoundingBox[], the value of
            unwritten components and corresponding bounding box coordinates is undefined
            for executions of the shader that take that path.
       </p>
      </div>
      <div class="refsect1" id="associatedgets">
        <h2>Associated Gets</h2>
        <p>
            <a class="citerefentry" href="glGet.xhtml"><span class="citerefentry"><span class="refentrytitle">glGet</span></span></a> with argument <code class="constant">GL_PRIMITIVE_BOUNDING_BOX</code>
        </p>
      </div>
      <div class="refsect1" id="versions">
        <h2>API Version Support</h2>
        <div class="informaltable">
          <table style="border-collapse: collapse; border-top: 2px solid ; border-bottom: 2px solid ; border-left: 2px solid ; border-right: 2px solid ; ">
            <colgroup>
              <col style="text-align: left; "/>
              <col style="text-align: center; " class="firstvers"/>
              <col style="text-align: center; "/>
              <col style="text-align: center; "/>
              <col style="text-align: center; " class="lastvers"/>
            </colgroup>
            <thead>
              <tr>
                <th style="text-align: left; border-right: 2px solid ; ">
                 
            </th>
                <th style="text-align: center; border-bottom: 2px solid ; " colspan="4">
                <span class="bold"><strong>OpenGL ES API Version</strong></span>
            </th>
              </tr>
              <tr>
                <th style="text-align: left; border-right: 2px solid ; border-bottom: 2px solid ; ">
                <span class="bold"><strong>Function Name</strong></span>
            </th>
                <th style="text-align: center; border-right: 2px solid ; border-bottom: 2px solid ; ">
                <span class="bold"><strong>2.0</strong></span>
            </th>
                <th style="text-align: center; border-right: 2px solid ; border-bottom: 2px solid ; ">
                <span class="bold"><strong>3.0</strong></span>
            </th>
                <th style="text-align: center; border-right: 2px solid ; border-bottom: 2px solid ; ">
                <span class="bold"><strong>3.1</strong></span>
            </th>
                <th style="text-align: center; border-bottom: 2px solid ; ">
                <span class="bold"><strong>3.2</strong></span>
            </th>
              </tr>
            </thead>
            <tbody>
              <tr>
                <td style="text-align: left; border-right: 2px solid ; ">glPrimitiveBoundingBox</td>
                <td style="text-align: center; border-right: 2px solid ; ">-</td>
                <td style="text-align: center; border-right: 2px solid ; ">-</td>
                <td style="text-align: center; border-right: 2px solid ; ">-</td>
                <td style="text-align: center; ">✔</td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
      <div class="refsect1" id="Copyright">
        <h2>Copyright</h2>
        <p>
            Copyright <span class="trademark"/>© 2015 Khronos Group.
            This document is licensed under the SGI Free Software B License.
            For details, see
            <a class="link" href="http://oss.sgi.com/projects/FreeB/" target="_top">http://oss.sgi.com/projects/FreeB/</a>.
        </p>
      </div>
    </div>
    <footer/>
  </body>
</html>
